//===================================================================
// 项目名 : Lean.Hbt
// 文件名 : assyOutputDetail.ts
// 创建者 : Claude
// 创建时间: 2024-12-19
// 版本号 : v1.0.0
// 描述    : 生产明细API接口
//===================================================================

import {request} from '@/utils/request'
import type { HbtPagedResult } from '@/types/common'
import type { 
  HbtAssyOutputDetail, 
  HbtAssyOutputDetailCreate, 
  HbtAssyOutputDetailUpdate,
  HbtAssyOutputDetailQuery
} from '@/types/logistics/manufacturing/execution/output/assyOutputDetail'

// 获取生产明细分页列表
export function getAssyOutputDetailList(query: HbtAssyOutputDetailQuery) {
  return request<HbtPagedResult<HbtAssyOutputDetail>>({
    url: '/api/HbtAssyOutputDetail/list',
    method: 'get',
    params: query
  })
}

// 获取生产明细详情
export function getAssyOutputDetail(id: number) {
  return request<HbtAssyOutputDetail>({
    url: `/api/HbtAssyOutputDetail/${id}`,
    method: 'get'
  })
}

// 创建生产明细
export function createAssyOutputDetail(data: HbtAssyOutputDetailCreate) {
  return request<HbtAssyOutputDetail>({
    url: '/api/HbtAssyOutputDetail',
    method: 'post',
    data
  })
}

// 更新生产明细
export function updateAssyOutputDetail(data: HbtAssyOutputDetailUpdate) {
  return request<HbtAssyOutputDetail>({
    url: `/api/HbtAssyOutputDetail/${data.assyOutputDetailId}`,
    method: 'put',
    data
  })
}

// 删除生产明细
export function deleteAssyOutputDetail(id: number) {
  return request<boolean>({
    url: `/api/HbtAssyOutputDetail/${id}`,
    method: 'delete'
  })
}

// 批量删除生产明细
export function batchDeleteAssyOutputDetail(ids: number[]) {
  return request<boolean>({
    url: '/api/HbtAssyOutputDetail/batch',
    method: 'delete',
    data: { ids }
  })
}
